// OGoMojo
// Whitemice.MOGI.RPC2.SubDocument
// License: LGPL
// Copyright: Whitemice Consulting, 2006
// Author(s): Adam Tauno Williams (awilliam@whitemice.org)
using System;
using CookComputing.XmlRpc;

namespace Whitemice.MOGI.RPC2 {
	public abstract class SubDocument : Document {
		protected IDocument	parentDocument;
		protected string		typeAbbrev;
		/// \brief Constructor
		/// \param document An XmlRpcStruct document
		/// \param parentDocument Reference to the parent document
		/// \param typeAbbrev The type of the subordinate element
		/// \param server Reference to server object		
		public SubDocument(XmlRpcStruct document, IDocument parentDocument, 
							string typeAbbrev, Server server) :
			base(document, server) {
			this.parentDocument = parentDocument;
			this.typeAbbrev = typeAbbrev;
		}
		
		/// \brief The type of the subordinate document
		public string TypeAbbreviation {
			get {
				return typeAbbrev;
			}
		}
		
		/// \brief Provide a version number
		/// \brief Since subdocuments don't have versions we return 0 always
		public override int Version {
			get{
		  		return 0;
		 	}
		 }
		 
		 public abstract bool Filled { get; }		
	}
}